﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};

	var auditData = Jxstar.findComboData('audit');
	var moneytypeData = Jxstar.findComboData('moneytype');
	var authtypeData = Jxstar.findComboData('authtype');

	var cols = [
	{col:{header:'记录状态', width:100, sortable:true, defaultval:'0', align:'center',
		editable:false,
		editor:new Ext.form.ComboBox({
			store: new Ext.data.SimpleStore({
				fields:['value','text'],
				data: auditData
			}),
			emptyText: jx.star.select,
			mode: 'local',
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text',
			editable:false,
			value: auditData[0][0]
		}),
		renderer:function(value){
			for (var i = 0; i < auditData.length; i++) {
				if (auditData[i][0] == value)
					return auditData[i][1];
			}
		}}, field:{name:'project_userchg__auditing',type:'string'}},
	{col:{header:'*项目编码', width:100, sortable:true, editable:true, hcss:'color:#0000ff;',
		editor:new Ext.form.TriggerField({
			maxLength:20,
			editable:false, allowBlank:false,
			triggerClass:'x-form-search-trigger', 
			onTriggerClick: function() {
				var selcfg = {pageType:'combogrid', nodeId:'project_select', layoutPage:'', sourceField:';', targetField:';', whereSql:"project_status ='2'", whereValue:'', whereType:'', isSame:'1', isShowData:'1', isMoreSelect:'0',isReadonly:'1',fieldName:'project_userchg.project_code'};
				JxSelect.createSelectWin(selcfg, this, 'node_project_userchg_editgrid');
			}
		})}, field:{name:'project_userchg__project_code',type:'string'}},
	{col:{header:'项目名称', width:219, sortable:true, editable:false,
		editor:new Ext.form.TextField({
			maxLength:100
		})}, field:{name:'project_userchg__project_name',type:'string'}},
	{col:{header:'实施部门', width:100, sortable:true, editable:false,
		editor:new Ext.form.TextField({
			maxLength:50
		})}, field:{name:'project_userchg__dept_name',type:'string'}},
	{col:{header:'项目类型', width:123, sortable:true, align:'center',
		editable:false,
		editor:new Ext.form.ComboBox({
			store: new Ext.data.SimpleStore({
				fields:['value','text'],
				data: moneytypeData
			}),
			emptyText: jx.star.select,
			mode: 'local',
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text',
			editable:false,
			value: moneytypeData[0][0]
		}),
		renderer:function(value){
			for (var i = 0; i < moneytypeData.length; i++) {
				if (moneytypeData[i][0] == value)
					return moneytypeData[i][1];
			}
		}}, field:{name:'project_userchg__money_type',type:'string'}},
	{col:{header:'授权形式', width:93, sortable:true, align:'center',
		editable:false,
		editor:new Ext.form.ComboBox({
			store: new Ext.data.SimpleStore({
				fields:['value','text'],
				data: authtypeData
			}),
			emptyText: jx.star.select,
			mode: 'local',
			triggerAction: 'all',
			valueField: 'value',
			displayField: 'text',
			editable:false,
			value: authtypeData[0][0]
		}),
		renderer:function(value){
			for (var i = 0; i < authtypeData.length; i++) {
				if (authtypeData[i][0] == value)
					return authtypeData[i][1];
			}
		}}, field:{name:'project_userchg__auth_type',type:'string'}},
	{col:{header:'原项目负责人', width:100, sortable:true, editable:false,
		editor:new Ext.form.TextField({
			maxLength:50
		})}, field:{name:'project_userchg__project_user',type:'string'}},
	{col:{header:'*变更后项目负责人', width:125, sortable:true, editable:true, hcss:'color:#0000ff;',
		editor:new Ext.form.TriggerField({
			maxLength:50,
			editable:false, allowBlank:false,
			triggerClass:'x-form-search-trigger', 
			onTriggerClick: function() {
				var selcfg = {pageType:'combogrid', nodeId:'sys_user', layoutPage:'/public/layout/layout_tree.js', sourceField:'sys_user.user_name;user_id', targetField:'project_userchg.project_user2;project_userid2', whereSql:"", whereValue:'', whereType:'', isSame:'0', isShowData:'1', isMoreSelect:'0',isReadonly:'1',fieldName:'project_userchg.project_user2'};
				JxSelect.createSelectWin(selcfg, this, 'node_project_userchg_editgrid');
			}
		})}, field:{name:'project_userchg__project_user2',type:'string'}},
	{col:{header:'变更后项目负责人ID', width:100, sortable:true, hidden:true}, field:{name:'project_userchg__project_userid2',type:'string'}},
	{col:{header:'变更原因', width:202, sortable:true, editable:true, hcss:'color:#3039b4;',
		editor:new Ext.form.TextField({
			maxLength:50
		})}, field:{name:'project_userchg__common',type:'string'}},
	{col:{header:'变更人', width:100, sortable:true, defaultval:'fun_getUserName()', editable:false,
		editor:new Ext.form.TextField({
			maxLength:50
		})}, field:{name:'project_userchg__userchg_user',type:'string'}},
	{col:{header:'变更时间', width:100, sortable:true, defaultval:'fun_getToday()', editable:false,
		editor:new Ext.form.DateField({
			format: 'Y-m-d',
			minValue: '1900-01-01'
		}),
		renderer:function(value) {
			return value ? value.format('Y-m-d') : '';
		}}, field:{name:'project_userchg__userchg_date',type:'date'}},
	{col:{header:'部门ID', width:100, sortable:true, hidden:true}, field:{name:'project_userchg__dept_id',type:'string'}},
	{col:{header:'原项目负责人ID', width:100, sortable:true, hidden:true}, field:{name:'project_userchg__project_userid',type:'string'}},
	{col:{header:'项目ID', width:100, sortable:true, hidden:true}, field:{name:'project_userchg__project_id',type:'string'}},
	{col:{header:'主键', width:100, sortable:true, hidden:true}, field:{name:'project_userchg__userchg_id',type:'string'}},
	{col:{header:'编制人ID', width:100, sortable:true, hidden:true}, field:{name:'project_userchg__userchg_userid',type:'string'}}
	];
	
	config.param = {
		cols: cols,
		sorts: null,
		hasQuery: '1',
		isedit: '1',
		isshow: '1',
		funid: 'project_userchg'
	};
	
	
		
	return new Jxstar.GridNode(config);
}